﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/Admin_MasterPage.Master" AutoEventWireup="true" CodeFile="CapNhatSanPham.aspx.cs" Inherits="Admin_CapNhatSanPham" %>
<%@ Register Assembly="FreeTextBox" Namespace="FreeTextBoxControls" TagPrefix="FTB" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<div id="allthemsanpham">
        <h3 style="color:Red; font-size:large;">Cập nhật sản phẩm</h3>
         <div id="contentthemsanpham" style="border:1px solid black;"> 
            
            <table border="1" id="table1" visible="false" cellspacing="0" >
                    <tr>
                        <td style="font-size:16px; color:#8B4513; width:200px;">Mã sản phẩm</td>
                        <td style="width:400px;"><asp:TextBox ID="txt_masp" runat="server" Width="400px" Enabled="False" ReadOnly="True"></asp:TextBox></td>
                        <td></td>
                    </tr>
                    <!-- End tr masanpham-->
                    <tr>
                    <td style="font-size:16px; color:#8B4513; width:200px;">Tên sản phẩm</td>
                    <td style="width:400px;"><asp:TextBox ID="txt_tensp" runat="server" Width="400px"></asp:TextBox></td>
                    <td style="color:Red;"><asp:RequiredFieldValidator
                            ID="RequiredFieldValidator1" runat="server" ErrorMessage="Không được bỏ trống" ControlToValidate="txt_tensp"></asp:RequiredFieldValidator></td>
                    </tr>
                    <!-- End tr tensanpham-->
                    <tr>
                    <td style="font-size:16px; color:#8B4513; width:200px;">Loại sản phẩm</td>
                    <td style="width:400px;"><asp:DropDownList ID="ddl_loaisp" runat="server" Width="200px"></asp:DropDownList></td>
                    <td></td>
                    </tr>
                    <!-- End tr loaisanpham-->
                    <tr>
                    <td style="font-size:16px; color:#8B4513; width:200px;">Nhà sản xuất</td>
                    <td style="width:400px;"><asp:DropDownList ID="ddl_nhasx" runat="server" Width="300px"></asp:DropDownList></td>
                    <td></td>
                    </tr> 
                    <!-- End tr nha san xuat-->
                    <tr>
                        <td style="font-size:16px; color:#8B4513; width:200px;">Hình Ảnh:</td>
                        <td style="width:400px;">
                            <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                             <Triggers>
                             <asp:AsyncPostBackTrigger ControlID="btn_ThemHinhAnhMoi" EventName="Click" />
                             <asp:AsyncPostBackTrigger ControlID="btn_CapNhatHinhAnh" EventName="Click" />
                             <asp:AsyncPostBackTrigger ControlID="btn_XoaHinhAnh" EventName="Click" />
                             </Triggers>
                             <ContentTemplate>
                                <asp:Repeater ID="repeater_hinhanh" runat="server" onitemdatabound="repeater_hinhanh_ItemDataBound" >
                                    <ItemTemplate>
                                        <div><asp:ImageMap ID="img_map" ImageUrl="" width="60px" height="60px" runat="server"></asp:ImageMap>
                                            <asp:FileUpload ID="FileUpload1" runat="server" Width="300px" />
                                            <asp:CheckBox ID="cb_Delete" runat="server"/>
                                            <asp:HiddenField ID="hf_ID" runat="server" />
                                        </div>
                                    </ItemTemplate>
                                </asp:Repeater>
                            </ContentTemplate>
                           </asp:UpdatePanel>
                       </td>
                        <td>
                        <div id="fileUploadarea">Thêm mới hình ảnh
                                <asp:FileUpload ID="FileUpload2" runat="server"/><br />
                            </div>
                            <div style="margin-left:30px; margin-top:10px;">
                            <div style="margin-left:70px;"><asp:Button CssClass="button" ID="btn_ThemHinhAnhMoi" runat="server" Text="Thêm ảnh mới" Width="133px" OnClick="btn_ThemHinhAnhMoi_Click"/></div>
                            <div><asp:Button CssClass="button" ID="btn_CapNhatHinhAnh" runat="server" Text="Cập nhật hình ảnh" Width="133px" OnClick="btn_CapNhatHinhAnh_Click"/>
                            <asp:Button CssClass="button" ID="btn_XoaHinhAnh" runat="server" Text="Xóa hình ảnh" Width="133px" OnClick="btn_XoaHinhAnh_Click"/>
                            </div>
                            <div></div>
                            <div style="color:Red;">Chú ý:</div>
                            <div style="color:Red;">1/ Mỗi lần chỉ có thể thêm 1 hình</div>
                            <div style="color:Red;">2/ Hình ảnh ở cột bên trái nếu chọn đường dẫn mới sẽ được cập nhật</div>
                            <div style="color:Red;">3/ Hình ảnh ở cột bên trái nếu được đánh dấu sẽ được xóa</div>
                            </div>
                        </td>
                    </tr>
                    <!-- End tr hinhanh-->
                    
                    <tr>
                    <td style="font-size:16px; color:#8B4513; width:200px;">CPU</td>
                    <td style="width:400px;"><asp:TextBox ID="txt_CPU" runat="server" Width="400px"></asp:TextBox></td>
                    <td></td>
                    </tr>
                    <!-- End tr cpu-->
                    <tr>
                    <td style="font-size:16px; color:#8B4513; width:200px;">RAM</td>
                    <td style="width:400px;"><asp:TextBox ID="txt_ram" runat="server" Width="400px"></asp:TextBox></td>
                    <td></td>
                    </tr>
                    <!-- End tr ram-->
                    <tr>
                    <td style="font-size:16px; color:#8B4513; width:200px;">HDD</td>
                    <td style="width:400px;"><asp:TextBox ID="txt_hdd" runat="server" Width="400px"></asp:TextBox></td>
                    <td></td>
                    </tr>
                    <!-- End tr hdd-->
                    <tr>
                    <td style="font-size:16px; color:#8B4513; width:200px;">Card màn hình</td>
                    <td style="width:400px;"><asp:TextBox ID="txt_cardmanhinh" runat="server" Width="400px"></asp:TextBox></td>
                    <td></td>
                    </tr>
                    <!-- End tr card man hinh-->
                    <tr>
                    <td style="font-size:16px; color:#8B4513; width:200px;">CD_DVD</td>
                    <td style="width:400px;"><asp:TextBox ID="txt_CD" runat="server" Width="400px"></asp:TextBox></td>
                    <td></td>
                    </tr>
                    <!-- End tr cd dvd-->
                    <tr>
                    <td style="font-size:16px; color:#8B4513; width:200px;">Màn hình</td>
                    <td style="width:400px;"><asp:TextBox ID="txt_manhinh" runat="server" Width="400px"></asp:TextBox></td>
                    <td></td>
                    </tr>
                    <!-- End tr manhinh-->
                    <tr>
                    <td style="font-size:16px; color:#8B4513; width:200px;">Mạng</td>
                    <td style="width:400px;"><asp:TextBox ID="txt_mang" runat="server" Width="400px"></asp:TextBox></td>
                    <td></td>
                    </tr>
                    <!-- End tr mang-->
                    <tr>
                    <td style="font-size:16px; color:#8B4513; width:200px;  vertical-align:middle;">Tích hợp</td>
                    <td style="width:400px;"><asp:TextBox ID="txt_tichhop" runat="server" Width="400px" TextMode="MultiLine" Height="50px"></asp:TextBox></td>
                    <td></td>
                    </tr>
                    <!-- End tr tichhop-->
                    <tr>
                    <td style="font-size:16px; color:#8B4513; width:200px;">Trọng lượng</td>
                    <td style="width:400px;"><asp:TextBox ID="txt_trongluong" runat="server" Width="400px"></asp:TextBox></td>
                    <td></td>
                    </tr>
                    <!-- End tr trong luong-->
                    <tr>
                    <td style="font-size:16px; color:#8B4513; width:200px;">Pin</td>
                    <td style="width:400px;"><asp:TextBox ID="txt_pin" runat="server" Width="400px"></asp:TextBox></td>
                    <td></td>
                    </tr>
                    <!-- End tr pin-->
                    <tr>
                    <td style="font-size:16px; color:#8B4513; width:200px;">Hệ điều hành</td>
                    <td style="width:400px;"><asp:TextBox ID="txt_hdh" runat="server" Width="400px"></asp:TextBox></td>
                    <td></td>
                    </tr>
                    <!-- End tr he dieu hanh-->
                    <tr>
                    <td style="font-size:16px; color:#8B4513; width:200px;">Thời gian bảo hành</td>
                    <td style="width:400px;"><asp:TextBox ID="txt_tgia_bhanh" runat="server" Width="400px"></asp:TextBox></td>
                    <td></td>
                    </tr>
                    <!-- End tr thoi gian bao hanh-->
                    <tr>
                    <td style="font-size:16px; color:#8B4513; width:200px;">Khuyến mãi</td>
                    <td style="width:400px;"><asp:TextBox ID="txt_khuyenmai" runat="server" Width="400px"></asp:TextBox></td>
                    <td></td>
                    </tr>
                    <!-- End tr khuyen mai-->
                    <tr>
                    <td style="font-size:16px; color:#8B4513; width:200px;">Giá</td>
                    <td style="width:400px;"><asp:TextBox ID="txt_gia" runat="server" Width="400px"></asp:TextBox></td>
                    <td><asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
                            ControlToValidate="txt_gia" ValidationExpression="([0-9])*" ErrorMessage="Giá phải là một số" 
                            ForeColor="Red"></asp:RegularExpressionValidator></td>
                    </tr>
                    <!-- End tr gia-->
                    
                    <tr>
                        <td colspan="3">
                        <div style="margin-left:300px;"><asp:Button CssClass="button" ID="bt_sua" runat="server" Text="Sửa sản phẩm" Width="133px" OnClick="btn_sua_Click"/>
                        
                        <asp:HyperLink CssClass="button" ID="btn_TroVe" NavigateUrl="~/Admin/DanhSachSanPham.aspx" runat="server">Trở về</asp:HyperLink>
                        </div>
                        </td>
                    </tr>
                    <!-- End tr button sua san pham-->
                </table>
        </div>
    </div>
</asp:Content>
